﻿using Authority.Doamin.View;
using HelperFromTheSkeleton.EFBaseRepository;
using System.Linq.Expressions;

namespace Authority.Doamin.IRepository
{
    /// <summary>
    /// 用户仓储
    /// </summary>
    public interface IUserRepository : IEFBaseRepository<User>
    {
        /// <summary>
        /// 查询用户角色视图
        /// </summary>
        /// <param name="expression"></param>
        /// <returns></returns>
        Task<List<UserRoleInfoView>> FindUserRoleInfoViewAsync(Expression<Func<User, bool>> expression);

        /// <summary>
        /// 查询用户菜单视图
        /// </summary>
        /// <param name="userExpression"></param>
        /// <param name="menuExpression"></param>
        /// <returns></returns>
        Task<List<UserMenuInfoView>> FindUserMenuInfoViewAsync(Expression<Func<User, bool>> userExpression, Expression<Func<MenuAuthority, bool>> menuExpression);

        /// <summary>
        /// 查询用户功能视图
        /// </summary>
        /// <param name="userExpression"></param>
        /// <param name="actionExpression"></param>
        /// <returns></returns>
        Task<List<UserActionInfoView>> FindUserActionInfoViewAsync(Expression<Func<User, bool>> userExpression, Expression<Func<ActionAuthority, bool>> actionExpression);

        /// <summary>
        /// 查询用户路由视图
        /// </summary>
        /// <param name="userExpression"></param>
        /// <param name="routingExpression"></param>
        /// <returns></returns>
        Task<List<UserRoutingView>> FindUserRoutingViewAsync(Expression<Func<User, bool>> userExpression, Expression<Func<RoutingAuthority, bool>> routingExpression);
    }
}
